/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package tk.eigh.ksvg.renderer.structure;

import tk.eigh.ksvg.renderer.SVGStructureRenderer;
import java.io.IOException;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.context.ResponseWriter;
import ksvg.structure.Group;
import org.apache.myfaces.buildtools.maven2.plugin.builder.annotation.JSFRenderer;
import tk.eigh.ksvg.SVG;
import tk.eigh.ksvg.renderer.SVGRenderer;

/**
 *
 * @author nt
 */
@JSFRenderer(renderKitId = "SVG", type = "structure.SVGGroupRenderer", family = "structure.Container")
public class SVGGroupRenderer extends SVGStructureRenderer {

    @Override
    public void encodeBegin(FacesContext context, UIComponent component) throws IOException {
        super.encodeBegin(context, component);
        ResponseWriter writer = context.getResponseWriter();
        Group group = (Group) component;
        writer.startElement(SVG.GROUP_TAG_NAME, component);
        renderCommonAttributes(writer,component,context);
    }

    @Override
    public void encodeEnd(FacesContext context, UIComponent component) throws IOException {
        super.encodeEnd(context, component);
        context.getResponseWriter().endElement(SVG.GROUP_TAG_NAME);
    }
}
